<template>
  <div>
    <el-dropdown class="userinfo" @command="handlecommand">
          <span class="el-dropdown-link">
              admin
          </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item command="userInfo">个人资料</el-dropdown-item>
        <el-dropdown-item command="setting">设置</el-dropdown-item>
        <el-dropdown-item command="logout">退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>

<script>
export default {
  name: 'EmpBasic',
  methods: {
    handlecommand(command) {
      this.$message('click on item ' + command);
      // if (command === 'logout') {
      //   //退出登录
      //   this.postRequest('/logout');
      //   window.sessionStorage.removeItem('tokenStr');
      //   window.sessionStorage.removeItem('user');
      //   //跳转到登录页
      //   this.$router.replace('/');
      // }
    }
  }
}
</script>

<style>

</style>